package com.sj.purchase.modules.cost.service.price;

import com.sj.purchase.modules.cost.domain.price.CostPrice;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by yangrd on 2017/10/26
 **/
public interface CostPriceService {

    /**
     * 获取移动成本价
     *
     * @param skuNo
     * @param date
     * @return
     */
    Double getCostPrice(String skuNo, Date date);

    List<CostPrice> listCostPrice(Date start, Date end);

    /**
     * key:sku value:list按时间倒序
     *
     * @param costPriceList
     * @return
     */
    Map<String, List<CostPrice>> getSkuCostPriceCache(List<CostPrice> costPriceList);


    /**
     * @param skuCostPriceCache list.costPrice.getCreateDate:时间需要倒序
     * @param skuNo
     * @param date
     * @return
     */
    Double getCostPrice(Map<String, List<CostPrice>> skuCostPriceCache, String skuNo, Date date);

    /**
     * 计算移动成本价
     */
    void calculateTheCostPrice(Date date);
}
